export default {
	userInfo(state) {
		return state.userInfo
	},
	token(state) {
		return state.token
	},
	hasLogin(_, getters) {
		return getters.token.length > 0
	},
	categoryList(state) {
		return state.categoryList
	},
	hasInit: state => state.location.hasInit,
	city: state => state.location.city || '暂未获取',
	cityId: state => state.location.cityId,
	shouldUpdate: state => state.location.shouldUpdate,
	location: state => state.location.location,
	contentHeight: state => state.contentHeight,
	userIdentity: (_, getters) => {
		const { userInfo } = getters
		if (!getters.hasLogin) return 0
		if (userInfo.hasOwnProperty('type')) {
			return userInfo.type
		}
		return 0
	},
	topHeight: state => state.statusBarHeight,
	loginSuccess: state => state.loginSuccess,
	hasLocation: state => state.hasLocation,
	historySearch: state => state.historySearch,
	recentlyData: state => state.location.recentlyData,
	bannerImage: state => state.bannerImage,
	addressText: state => state.location.addressText
}